package com.xyh;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.awt.*;

@RestController
public class TestController {
    @Autowired
    private HelloClient helloClient;
    @RequestMapping(method= RequestMethod.GET,value = "/router")
    public String router(){
       String result=helloClient.hello("argus");
       return result;
    }
    @RequestMapping(method = RequestMethod.GET,value = "/police",produces = MediaType.APPLICATION_JSON_VALUE)
    public Police getPolic(){
     Police police  =   helloClient.getPolic(1);
     return police;
    }
    @RequestMapping(method = RequestMethod.GET,value = "/myhello")
    public String myHello(){
      return helloClient.myHello();
    }
}
